<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Repetier-Firmware: src/ArduinoAVR/Repetier/HAL.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="icon128.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Repetier-Firmware
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('_h_a_l_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">HAL.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_h_a_l_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">    This file is part of Repetier-Firmware.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">    Repetier-Firmware is free software: you can redistribute it and/or modify</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">    it under the terms of the GNU General Public License as published by</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">    the Free Software Foundation, either version 3 of the License, or</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">    (at your option) any later version.</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">    Repetier-Firmware is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">    GNU General Public License for more details.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">    You should have received a copy of the GNU General Public License</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment">    along with Repetier-Firmware.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment">    This firmware is a nearly complete rewrite of the sprinter firmware</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">    by kliment (https://github.com/kliment/Sprinter)</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment">    which based on Tonokip RepRap firmware rewrite based off of Hydra-mmm firmware.</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment">  Functions in this file are used to communicate using ascii or repetier protocol.</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#ifndef HAL_H</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#define HAL_H</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;</div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &lt;avr/pgmspace.h&gt;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &lt;avr/io.h&gt;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a2eb6f9e0395b47b8d5e3eeae4fe0c116">   37</a></span>&#160;<span class="preprocessor">#define INLINE __attribute__((always_inline))</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#if CPU_ARCH == ARCH_AVR</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &lt;avr/io.h&gt;</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;<span class="preprocessor">#define PROGMEM</span></div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#define PGM_P const char *</span></div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;<span class="preprocessor">#define PSTR(s) s</span></div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;<span class="preprocessor">#define pgm_read_byte_near(x) (*(uint8_t*)x)</span></div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;<span class="preprocessor">#define pgm_read_byte(x) (*(uint8_t*)x)</span></div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a085f543ccded0731c1191e9c76a27311">   49</a></span>&#160;<span class="preprocessor">#define PACK</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ae68067bbb7e4e74e66a097cf20f69a96">   51</a></span>&#160;<span class="preprocessor">#define FSTRINGVALUE(var,value) const char var[] PROGMEM = value;</span></div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a9647b2e4e353b8a4c966dc7078ef1e73">   52</a></span>&#160;<span class="preprocessor">#define FSTRINGVAR(var) static const char var[] PROGMEM;</span></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a6c7567c1812b6b6ca9067377476ddc4e">   53</a></span>&#160;<span class="preprocessor">#define FSTRINGPARAM(var) PGM_P var</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">#include &lt;avr/eeprom.h&gt;</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">#include &lt;avr/wdt.h&gt;</span></div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a806ea970ccbc3c57a4d4ad45dbbb4725">   60</a></span>&#160;<span class="preprocessor">#define TIMER0_PRESCALE 64</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a2fc5c022ca08920b3cf6eba085e5798e">   62</a></span>&#160;<span class="preprocessor">#define ANALOG_PRESCALER _BV(ADPS0)|_BV(ADPS1)|_BV(ADPS2)</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="preprocessor">#if MOTHERBOARD==8 || MOTHERBOARD==88 || MOTHERBOARD==9 || MOTHERBOARD==92 || CPU_ARCH!=ARCH_AVR</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="preprocessor">#define EXTERNALSERIAL</span></div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="preprocessor">#if NEW_COMMUNICATION &amp;&amp; defined(BLUETOOTH_SERIAL) &amp;&amp; BLUETOOTH_SERIAL &gt; 0</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="preprocessor">#undef EXTERNALSERIAL</span></div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;<span class="preprocessor">#define EXTERNALSERIAL</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;<span class="comment">//#define EXTERNALSERIAL  // Force using Arduino serial</span></div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;<span class="preprocessor">#ifndef EXTERNALSERIAL</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;<span class="preprocessor">#undef HardwareSerial_h</span></div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a303b63294d669d2c5a269c92bdb700d5">   75</a></span>&#160;<span class="preprocessor">#define  HardwareSerial_h // Don&#39;t use standard serial console</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;<span class="preprocessor">#include &lt;inttypes.h&gt;</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor">#include &quot;Stream.h&quot;</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;<span class="preprocessor">#ifdef EXTERNALSERIAL</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;<span class="preprocessor">#define SERIAL_RX_BUFFER_SIZE 128</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;<span class="preprocessor">#if defined(ARDUINO) &amp;&amp; ARDUINO &gt;= 100</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;<span class="preprocessor">#include &quot;Arduino.h&quot;</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="preprocessor">#include &quot;WProgram.h&quot;</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a8632c40d5411175b1dd8044667d2e265">   86</a></span>&#160;<span class="preprocessor">#define COMPAT_PRE1</span></div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;<span class="preprocessor">#if CPU_ARCH==ARCH_AVR</span></div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="fastio_8h.html">fastio.h</a>&quot;</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;<span class="preprocessor">#define READ(IO)  digitalRead(IO)</span></div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;<span class="preprocessor">#define WRITE(IO, v)  digitalWrite(IO, v)</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;<span class="preprocessor">#define SET_INPUT(IO)  pinMode(IO, INPUT)</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;<span class="preprocessor">#define SET_OUTPUT(IO)  pinMode(IO, OUTPUT)</span></div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;<span class="preprocessor">#ifndef cbi</span></div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ae70baf5399951da1e7ad45a0ed890832">   97</a></span>&#160;<span class="preprocessor">#define cbi(sfr, bit) (_SFR_BYTE(sfr) &amp;= ~_BV(bit))</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;<span class="preprocessor">#ifndef sbi</span></div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ac4a5536d9bf092116f88b94797ddc882">  100</a></span>&#160;<span class="preprocessor">#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html">  103</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_interrupt_protected_block.html">InterruptProtectedBlock</a></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;{</div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html#a8b4978ff4726206e8739c7cbbd660ad7">  105</a></span>&#160;    uint8_t <a class="code" href="class_interrupt_protected_block.html#a8b4978ff4726206e8739c7cbbd660ad7">sreg</a>;</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html#a9b73a25ab6cd42d6a583b0f13f78ead1">  107</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_interrupt_protected_block.html#a9b73a25ab6cd42d6a583b0f13f78ead1">protect</a>()</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    {</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        cli();</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;    }</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html#a60d6685bf1195357503d24348b7dee97">  112</a></span>&#160;    <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_interrupt_protected_block.html#a60d6685bf1195357503d24348b7dee97">unprotect</a>()</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    {</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        SREG = <a class="code" href="class_interrupt_protected_block.html#a8b4978ff4726206e8739c7cbbd660ad7">sreg</a>;</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    }</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html#a51aa9f4410ffdd3f9c46bcdb9122a91c">  117</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="class_interrupt_protected_block.html#a51aa9f4410ffdd3f9c46bcdb9122a91c">InterruptProtectedBlock</a>(<span class="keywordtype">bool</span> later = <span class="keyword">false</span>)</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;    {</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        sreg = SREG;</div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">if</span>(!later)</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            cli();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;    }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;</div><div class="line"><a name="l00124"></a><span class="lineno"><a class="line" href="class_interrupt_protected_block.html#a2fe8f727f9bb277945286d6d89a623b9">  124</a></span>&#160;    <span class="keyword">inline</span> <a class="code" href="class_interrupt_protected_block.html#a2fe8f727f9bb277945286d6d89a623b9">~InterruptProtectedBlock</a>()</div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;    {</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;        SREG = <a class="code" href="class_interrupt_protected_block.html#a8b4978ff4726206e8739c7cbbd660ad7">sreg</a>;</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;    }</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;};</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;</div><div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">  130</a></span>&#160;<span class="preprocessor">#define EEPROM_OFFSET               0</span></div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a6252b6137f2c7128b048b21f86157df7">  131</a></span>&#160;<span class="preprocessor">#define SECONDS_TO_TICKS(s) (unsigned long)(s*(float)F_CPU)</span></div><div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#aae780ad1da65e93031c8819fa64c133e">  132</a></span>&#160;<span class="preprocessor">#define ANALOG_INPUT_SAMPLE 5</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;<span class="comment">// Bits of the ADC converter</span></div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a1972fe1bfaa6fb52001d04fc1059e3ad">  134</a></span>&#160;<span class="preprocessor">#define ANALOG_INPUT_BITS 10</span></div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a539de0f4b3ccbe41a4c8af7bfc6a4aa2">  135</a></span>&#160;<span class="preprocessor">#define ANALOG_REDUCE_BITS 0</span></div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a87a291b3b9207590f54f559d3bedd622">  136</a></span>&#160;<span class="preprocessor">#define ANALOG_REDUCE_FACTOR 1</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a44caf16d49cdf922186674a1421b558d">  138</a></span>&#160;<span class="preprocessor">#define MAX_RAM 32767</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#aef8a3a7087d7b20787653fb31b72c96f">  140</a></span>&#160;<span class="preprocessor">#define bit_clear(x,y) x&amp;= ~(1&lt;&lt;y) //cbi(x,y)</span></div><div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a22db3eec77988c276bf7ff6a7ee2e5b0">  141</a></span>&#160;<span class="preprocessor">#define bit_set(x,y)   x|= (1&lt;&lt;y)//sbi(x,y)</span></div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;</div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ab5c0fbe837494c5f9130a5914854250d">  144</a></span>&#160;<span class="preprocessor">#define I2C_READ    1</span></div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a9536bf85bced4f4e549a82fb18eb6140">  146</a></span>&#160;<span class="preprocessor">#define I2C_WRITE   0</span></div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;<span class="preprocessor">#if NONLINEAR_SYSTEM</span></div><div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;<span class="comment">// Maximum speed with 100% interrupt utilization is 27000 Hz at 16MHz cpu</span></div><div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160;<span class="comment">// leave some margin for all the extra transformations. So we keep inside clean timings.</span></div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#define LIMIT_INTERVAL ((F_CPU/30000)+1)</span></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a3e637e71ee4590cec2134e604723eff9">  153</a></span>&#160;<span class="preprocessor">#define LIMIT_INTERVAL ((F_CPU/40000)+1)</span></div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a80a0874aa42d7783b26fce1ea16f6658">  156</a></span>&#160;<span class="keyword">typedef</span> uint16_t <a class="code" href="_h_a_l_8h.html#a80a0874aa42d7783b26fce1ea16f6658">speed_t</a>;</div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a19b13c479504642297e7ebbf5da5677b">  157</a></span>&#160;<span class="keyword">typedef</span> uint32_t <a class="code" href="_h_a_l_8h.html#a19b13c479504642297e7ebbf5da5677b">ticks_t</a>;</div><div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a5f255edd429b0abc92fae25c511d45a7">  158</a></span>&#160;<span class="keyword">typedef</span> uint32_t <a class="code" href="_h_a_l_8h.html#a5f255edd429b0abc92fae25c511d45a7">millis_t</a>;</div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a21799deb67a18c9ab43cbcc0b0131c27">  159</a></span>&#160;<span class="keyword">typedef</span> uint8_t <a class="code" href="_h_a_l_8h.html#a21799deb67a18c9ab43cbcc0b0131c27">flag8_t</a>;</div><div class="line"><a name="l00160"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#adfaa4526bb47342be47f89a9eb6b3bef">  160</a></span>&#160;<span class="keyword">typedef</span> int8_t <a class="code" href="_h_a_l_8h.html#adfaa4526bb47342be47f89a9eb6b3bef">fast8_t</a>;</div><div class="line"><a name="l00161"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a3f1bffae8d9bb8c41c21d1924b5c294c">  161</a></span>&#160;<span class="keyword">typedef</span> uint8_t <a class="code" href="_h_a_l_8h.html#a3f1bffae8d9bb8c41c21d1924b5c294c">ufast8_t</a>;</div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;</div><div class="line"><a name="l00163"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ade10189dcb8536dc4c28a5b59d3035c5">  163</a></span>&#160;<span class="preprocessor">#define FAST_INTEGER_SQRT</span></div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;<span class="preprocessor">#ifndef EXTERNALSERIAL</span></div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;<span class="comment">// Implement serial communication for one stream only!</span></div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="comment">  HardwareSerial.h - Hardware serial library for Wiring</span></div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">  Copyright (c) 2006 Nicholas Zambetti.  All right reserved.</span></div><div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment">  This library is free software; you can redistribute it and/or</span></div><div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;<span class="comment">  modify it under the terms of the GNU Lesser General Public</span></div><div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;<span class="comment">  License as published by the Free Software Foundation; either</span></div><div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;<span class="comment">  version 2.1 of the License, or (at your option) any later version.</span></div><div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;<span class="comment">  This library is distributed in the hope that it will be useful,</span></div><div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;<span class="comment">  but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;<span class="comment">  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span></div><div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment">  Lesser General Public License for more details.</span></div><div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">  You should have received a copy of the GNU Lesser General Public</span></div><div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment">  License along with this library; if not, write to the Free Software</span></div><div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;<span class="comment">  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;<span class="comment">  Modified 28 September 2010 by Mark Sproul</span></div><div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment">  Modified to use only 1 queue with fixed length by Repetier</span></div><div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;</div><div class="line"><a name="l00190"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#aaa07390e6158db5d82d40510d2ae02d5">  190</a></span>&#160;<span class="preprocessor">#define SERIAL_BUFFER_SIZE 128</span></div><div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a802cf662365d7027fced85e4bfb8b968">  191</a></span>&#160;<span class="preprocessor">#define SERIAL_BUFFER_MASK 127</span></div><div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;<span class="preprocessor">#undef SERIAL_TX_BUFFER_SIZE</span></div><div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<span class="preprocessor">#undef SERIAL_TX_BUFFER_MASK</span></div><div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="preprocessor">#ifdef BIG_OUTPUT_BUFFER</span></div><div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="preprocessor">  #define SERIAL_TX_BUFFER_SIZE 128</span></div><div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;<span class="preprocessor">  #define SERIAL_TX_BUFFER_MASK 127</span></div><div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00198"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#af0d9a9a9aac810bf58f698086f76e516">  198</a></span>&#160;<span class="preprocessor">  #define SERIAL_TX_BUFFER_SIZE 64</span></div><div class="line"><a name="l00199"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#aa9e24a9121e507c4f7a0ed7a06c77763">  199</a></span>&#160;<span class="preprocessor">  #define SERIAL_TX_BUFFER_MASK 63</span></div><div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;</div><div class="line"><a name="l00202"></a><span class="lineno"><a class="line" href="structring__buffer.html">  202</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structring__buffer.html">ring_buffer</a></div><div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;{</div><div class="line"><a name="l00204"></a><span class="lineno"><a class="line" href="structring__buffer.html#aeca719034fa6c52086936629e6cb3d39">  204</a></span>&#160;    uint8_t buffer[<a class="code" href="_h_a_l_8h.html#aaa07390e6158db5d82d40510d2ae02d5">SERIAL_BUFFER_SIZE</a>];</div><div class="line"><a name="l00205"></a><span class="lineno"><a class="line" href="structring__buffer.html#a6a4c701d83019fe9b6ce59e39daf7925">  205</a></span>&#160;    <span class="keyword">volatile</span> uint8_t <a class="code" href="structring__buffer.html#a6a4c701d83019fe9b6ce59e39daf7925">head</a>;</div><div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="structring__buffer.html#a612d23af97374f5dd9e3c0eab8eadc89">  206</a></span>&#160;    <span class="keyword">volatile</span> uint8_t <a class="code" href="structring__buffer.html#a612d23af97374f5dd9e3c0eab8eadc89">tail</a>;</div><div class="line"><a name="l00207"></a><span class="lineno">  207</span>&#160;};</div><div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="structring__buffer__tx.html">  208</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structring__buffer__tx.html">ring_buffer_tx</a></div><div class="line"><a name="l00209"></a><span class="lineno">  209</span>&#160;{</div><div class="line"><a name="l00210"></a><span class="lineno"><a class="line" href="structring__buffer__tx.html#aab5f1b6ea5d89a003d53f8ca09d354db">  210</a></span>&#160;    uint8_t buffer[<a class="code" href="_h_a_l_8h.html#af0d9a9a9aac810bf58f698086f76e516">SERIAL_TX_BUFFER_SIZE</a>];</div><div class="line"><a name="l00211"></a><span class="lineno"><a class="line" href="structring__buffer__tx.html#a51a189b8d08a2712ea0bc7f2a64b4106">  211</a></span>&#160;    <span class="keyword">volatile</span> uint8_t <a class="code" href="structring__buffer__tx.html#a51a189b8d08a2712ea0bc7f2a64b4106">head</a>;</div><div class="line"><a name="l00212"></a><span class="lineno"><a class="line" href="structring__buffer__tx.html#a3e2ee9eff771641b8f0d218d89a760a6">  212</a></span>&#160;    <span class="keyword">volatile</span> uint8_t <a class="code" href="structring__buffer__tx.html#a3e2ee9eff771641b8f0d218d89a760a6">tail</a>;</div><div class="line"><a name="l00213"></a><span class="lineno">  213</span>&#160;};</div><div class="line"><a name="l00214"></a><span class="lineno">  214</span>&#160;</div><div class="line"><a name="l00215"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html">  215</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_r_f_hardware_serial.html">RFHardwareSerial</a> : <span class="keyword">public</span> Stream</div><div class="line"><a name="l00216"></a><span class="lineno">  216</span>&#160;{</div><div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00218"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#ae094d10bba86856d32d8aef2c6103fd0">  218</a></span>&#160;    <a class="code" href="structring__buffer.html">ring_buffer</a> *<a class="code" href="class_r_f_hardware_serial.html#ae094d10bba86856d32d8aef2c6103fd0">_rx_buffer</a>;</div><div class="line"><a name="l00219"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a079df5a8be5f117e0ec5deafdde02fa2">  219</a></span>&#160;    <a class="code" href="structring__buffer__tx.html">ring_buffer_tx</a> *<a class="code" href="class_r_f_hardware_serial.html#a079df5a8be5f117e0ec5deafdde02fa2">_tx_buffer</a>;</div><div class="line"><a name="l00220"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#acf7cd14be8d0209dba34fa8c4451854d">  220</a></span>&#160;    <span class="keyword">volatile</span> uint8_t *<a class="code" href="class_r_f_hardware_serial.html#acf7cd14be8d0209dba34fa8c4451854d">_ubrrh</a>;</div><div class="line"><a name="l00221"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a95201b78e2d373b9d862c83cf50d9f7b">  221</a></span>&#160;    <span class="keyword">volatile</span> uint8_t *<a class="code" href="class_r_f_hardware_serial.html#a95201b78e2d373b9d862c83cf50d9f7b">_ubrrl</a>;</div><div class="line"><a name="l00222"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#aaa49c44c6ae37ac0f72436fe86445abc">  222</a></span>&#160;    <span class="keyword">volatile</span> uint8_t *<a class="code" href="class_r_f_hardware_serial.html#aaa49c44c6ae37ac0f72436fe86445abc">_ucsra</a>;</div><div class="line"><a name="l00223"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a4f606b28efe0a9c8da02d39e4873da3a">  223</a></span>&#160;    <span class="keyword">volatile</span> uint8_t *<a class="code" href="class_r_f_hardware_serial.html#a4f606b28efe0a9c8da02d39e4873da3a">_ucsrb</a>;</div><div class="line"><a name="l00224"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a9f98a4add0666d6e74f2e3d9b276b053">  224</a></span>&#160;    <span class="keyword">volatile</span> uint8_t *<a class="code" href="class_r_f_hardware_serial.html#a9f98a4add0666d6e74f2e3d9b276b053">_udr</a>;</div><div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#acece6a5e7d8983146c068386b4f0febc">  225</a></span>&#160;    uint8_t <a class="code" href="class_r_f_hardware_serial.html#acece6a5e7d8983146c068386b4f0febc">_rxen</a>;</div><div class="line"><a name="l00226"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a51cc8931325840bea73281ae1f9b440f">  226</a></span>&#160;    uint8_t <a class="code" href="class_r_f_hardware_serial.html#a51cc8931325840bea73281ae1f9b440f">_txen</a>;</div><div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a9d5f3f3062701316ad2d893e051c6f6f">  227</a></span>&#160;    uint8_t <a class="code" href="class_r_f_hardware_serial.html#a9d5f3f3062701316ad2d893e051c6f6f">_rxcie</a>;</div><div class="line"><a name="l00228"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#a77ffe7e3825e50679393ae899660ab3c">  228</a></span>&#160;    uint8_t <a class="code" href="class_r_f_hardware_serial.html#a77ffe7e3825e50679393ae899660ab3c">_udrie</a>;</div><div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="class_r_f_hardware_serial.html#aeecf76372c636a0e320c39b52a96ac45">  229</a></span>&#160;    uint8_t <a class="code" href="class_r_f_hardware_serial.html#aeecf76372c636a0e320c39b52a96ac45">_u2x</a>;</div><div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;    <a class="code" href="class_r_f_hardware_serial.html">RFHardwareSerial</a>(<a class="code" href="structring__buffer.html">ring_buffer</a> *rx_buffer, <a class="code" href="structring__buffer__tx.html">ring_buffer_tx</a> *tx_buffer,</div><div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;                     <span class="keyword">volatile</span> uint8_t *ubrrh, <span class="keyword">volatile</span> uint8_t *ubrrl,</div><div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;                     <span class="keyword">volatile</span> uint8_t *ucsra, <span class="keyword">volatile</span> uint8_t *ucsrb,</div><div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;                     <span class="keyword">volatile</span> uint8_t *udr,</div><div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;                     uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udrie, uint8_t u2x);</div><div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;    <span class="keywordtype">void</span> begin(<span class="keywordtype">unsigned</span> <span class="keywordtype">long</span>);</div><div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    <span class="keywordtype">void</span> end();</div><div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> available(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> peek(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">int</span> read(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> flush(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160;<span class="preprocessor">#ifdef COMPAT_PRE1</span></div><div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">void</span> write(uint8_t);</div><div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;    <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> write(uint8_t);</div><div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;    <span class="keyword">using</span> Print::write; <span class="comment">// pull in write(str) and write(buf, size) from Print</span></div><div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;    <span class="keyword">operator</span> bool();</div><div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;    <span class="keywordtype">int</span> outputUnused(<span class="keywordtype">void</span>); <span class="comment">// Used for output in interrupts</span></div><div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160;};</div><div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;<span class="keyword">extern</span> <a class="code" href="class_r_f_hardware_serial.html">RFHardwareSerial</a> <a class="code" href="_h_a_l_8h.html#afbb1290b3ca9b145cd2f83d39cccf570">RFSerial</a>;</div><div class="line"><a name="l00252"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">  252</a></span>&#160;<span class="preprocessor">#define RFSERIAL RFSerial</span></div><div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;<span class="comment">//extern ring_buffer tx_buffer;</span></div><div class="line"><a name="l00254"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a2460646a2c88b65c0f8d1b9ba7c8d0f5">  254</a></span>&#160;<span class="preprocessor">#define WAIT_OUT_EMPTY while(tx_buffer.head != tx_buffer.tail) {}</span></div><div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;<span class="preprocessor">#define RFSERIAL Serial</span></div><div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;<span class="preprocessor">#if defined(BLUETOOTH_SERIAL) &amp;&amp; BLUETOOTH_SERIAL &gt; 0</span></div><div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;<span class="preprocessor">#if BLUETOOTH_SERIAL == 1</span></div><div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;<span class="preprocessor">#define RFSERIAL2 Serial1</span></div><div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="preprocessor">#elif BLUETOOTH_SERIAL == 2</span></div><div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="preprocessor">#define RFSERIAL2 Serial2</span></div><div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;<span class="preprocessor">#elif BLUETOOTH_SERIAL == 3</span></div><div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;<span class="preprocessor">#define RFSERIAL2 Serial3</span></div><div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;<span class="preprocessor">#elif BLUETOOTH_SERIAL == 4</span></div><div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;<span class="preprocessor">#define RFSERIAL2 Serial4</span></div><div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;<span class="preprocessor">#elif BLUETOOTH_SERIAL == 5</span></div><div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;<span class="preprocessor">#define RFSERIAL2 Serial5</span></div><div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;</div><div class="line"><a name="l00272"></a><span class="lineno"><a class="line" href="class_h_a_l.html">  272</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_h_a_l.html">HAL</a></div><div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160;{</div><div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;<span class="preprocessor">#if FEATURE_WATCHDOG</span></div><div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">bool</span> wdPinged;</div><div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160;    <a class="code" href="class_h_a_l.html">HAL</a>();</div><div class="line"><a name="l00279"></a><span class="lineno">  279</span>&#160;    <span class="keyword">virtual</span> ~<a class="code" href="class_h_a_l.html">HAL</a>();</div><div class="line"><a name="l00280"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a64f198bc017b27419068232d6e7b10c9">  280</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a64f198bc017b27419068232d6e7b10c9">hwSetup</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00281"></a><span class="lineno">  281</span>&#160;    {}</div><div class="line"><a name="l00282"></a><span class="lineno">  282</span>&#160;    <span class="comment">// return val*val</span></div><div class="line"><a name="l00283"></a><span class="lineno">  283</span>&#160;    <span class="keyword">static</span> uint16_t integerSqrt(uint32_t a);</div><div class="line"><a name="l00291"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a39e4e2dc4288878b5525a625d8fe129c">  291</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> int32_t <a class="code" href="class_h_a_l.html#a39e4e2dc4288878b5525a625d8fe129c">Div4U2U</a>(uint32_t a,uint16_t b)</div><div class="line"><a name="l00292"></a><span class="lineno">  292</span>&#160;    {</div><div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;<span class="preprocessor">#if CPU_ARCH==ARCH_AVR</span></div><div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;        <span class="comment">// r14/r15 remainder</span></div><div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;        <span class="comment">// r16 counter</span></div><div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;        __asm__ __volatile__ (</div><div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;            <span class="stringliteral">&quot;clr r14 \n\t&quot;</span></div><div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;            <span class="stringliteral">&quot;sub r15,r15 \n\t&quot;</span></div><div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;            <span class="stringliteral">&quot;tst %D0 \n\t&quot;</span></div><div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;            <span class="stringliteral">&quot;brne do32%= \n\t&quot;</span></div><div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;            <span class="stringliteral">&quot;tst %C0 \n\t&quot;</span></div><div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160;            <span class="stringliteral">&quot;breq donot24%= \n\t&quot;</span></div><div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;            <span class="stringliteral">&quot;rjmp do24%= \n\t&quot;</span></div><div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160;            <span class="stringliteral">&quot;donot24%=:&quot;</span> <span class="stringliteral">&quot;ldi r16,17 \n\t&quot;</span> <span class="comment">// 16 Bit divide</span></div><div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;            <span class="stringliteral">&quot;d16u_1%=:&quot;</span> <span class="stringliteral">&quot;rol %A0 \n\t&quot;</span></div><div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;            <span class="stringliteral">&quot;rol %B0 \n\t&quot;</span></div><div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;            <span class="stringliteral">&quot;dec r16 \n\t&quot;</span></div><div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;            <span class="stringliteral">&quot;brne       d16u_2%= \n\t&quot;</span></div><div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;            <span class="stringliteral">&quot;rjmp end%= \n\t&quot;</span></div><div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;            <span class="stringliteral">&quot;d16u_2%=:&quot;</span> <span class="stringliteral">&quot;rol r14 \n\t&quot;</span></div><div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;            <span class="stringliteral">&quot;rol r15 \n\t&quot;</span></div><div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;            <span class="stringliteral">&quot;sub r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160;            <span class="stringliteral">&quot;sbc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;            <span class="stringliteral">&quot;brcc       d16u_3%= \n\t&quot;</span></div><div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;            <span class="stringliteral">&quot;add r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;            <span class="stringliteral">&quot;adc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;            <span class="stringliteral">&quot;clc \n\t&quot;</span></div><div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;            <span class="stringliteral">&quot;rjmp d16u_1%= \n\t&quot;</span></div><div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;            <span class="stringliteral">&quot;d16u_3%=:&quot;</span> <span class="stringliteral">&quot;sec \n\t&quot;</span></div><div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;            <span class="stringliteral">&quot;rjmp d16u_1%= \n\t&quot;</span></div><div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;            <span class="stringliteral">&quot;do32%=:&quot;</span> <span class="comment">// divide full 32 bit</span></div><div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160;            <span class="stringliteral">&quot;rjmp do32B%= \n\t&quot;</span></div><div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;            <span class="stringliteral">&quot;do24%=:&quot;</span> <span class="comment">// divide 24 bit</span></div><div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;</div><div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;            <span class="stringliteral">&quot;ldi r16,25 \n\t&quot;</span> <span class="comment">// 24 Bit divide</span></div><div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            <span class="stringliteral">&quot;d24u_1%=:&quot;</span> <span class="stringliteral">&quot;rol %A0 \n\t&quot;</span></div><div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;            <span class="stringliteral">&quot;rol %B0 \n\t&quot;</span></div><div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160;            <span class="stringliteral">&quot;rol %C0 \n\t&quot;</span></div><div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;            <span class="stringliteral">&quot;dec r16 \n\t&quot;</span></div><div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;            <span class="stringliteral">&quot;brne       d24u_2%= \n\t&quot;</span></div><div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;            <span class="stringliteral">&quot;rjmp end%= \n\t&quot;</span></div><div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;            <span class="stringliteral">&quot;d24u_2%=:&quot;</span> <span class="stringliteral">&quot;rol r14 \n\t&quot;</span></div><div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;            <span class="stringliteral">&quot;rol r15 \n\t&quot;</span></div><div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;            <span class="stringliteral">&quot;sub r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;            <span class="stringliteral">&quot;sbc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160;            <span class="stringliteral">&quot;brcc       d24u_3%= \n\t&quot;</span></div><div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;            <span class="stringliteral">&quot;add r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;            <span class="stringliteral">&quot;adc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;            <span class="stringliteral">&quot;clc \n\t&quot;</span></div><div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;            <span class="stringliteral">&quot;rjmp d24u_1%= \n\t&quot;</span></div><div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;            <span class="stringliteral">&quot;d24u_3%=:&quot;</span> <span class="stringliteral">&quot;sec \n\t&quot;</span></div><div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;            <span class="stringliteral">&quot;rjmp d24u_1%= \n\t&quot;</span></div><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;</div><div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;            <span class="stringliteral">&quot;do32B%=:&quot;</span> <span class="comment">// divide full 32 bit</span></div><div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;</div><div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;            <span class="stringliteral">&quot;ldi r16,33 \n\t&quot;</span> <span class="comment">// 32 Bit divide</span></div><div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            <span class="stringliteral">&quot;d32u_1%=:&quot;</span> <span class="stringliteral">&quot;rol %A0 \n\t&quot;</span></div><div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;            <span class="stringliteral">&quot;rol %B0 \n\t&quot;</span></div><div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;            <span class="stringliteral">&quot;rol %C0 \n\t&quot;</span></div><div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;            <span class="stringliteral">&quot;rol %D0 \n\t&quot;</span></div><div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;            <span class="stringliteral">&quot;dec r16 \n\t&quot;</span></div><div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;            <span class="stringliteral">&quot;brne       d32u_2%= \n\t&quot;</span></div><div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;            <span class="stringliteral">&quot;rjmp end%= \n\t&quot;</span></div><div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;            <span class="stringliteral">&quot;d32u_2%=:&quot;</span> <span class="stringliteral">&quot;rol r14 \n\t&quot;</span></div><div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;            <span class="stringliteral">&quot;rol r15 \n\t&quot;</span></div><div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;            <span class="stringliteral">&quot;sub r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;            <span class="stringliteral">&quot;sbc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160;            <span class="stringliteral">&quot;brcc       d32u_3%= \n\t&quot;</span></div><div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;            <span class="stringliteral">&quot;add r14,%A2 \n\t&quot;</span></div><div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;            <span class="stringliteral">&quot;adc r15,%B2 \n\t&quot;</span></div><div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;            <span class="stringliteral">&quot;clc \n\t&quot;</span></div><div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;            <span class="stringliteral">&quot;rjmp d32u_1%= \n\t&quot;</span></div><div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160;            <span class="stringliteral">&quot;d32u_3%=:&quot;</span> <span class="stringliteral">&quot;sec \n\t&quot;</span></div><div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;            <span class="stringliteral">&quot;rjmp d32u_1%= \n\t&quot;</span></div><div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160;</div><div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;            <span class="stringliteral">&quot;end%=:&quot;</span> <span class="comment">// end</span></div><div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;            :<span class="stringliteral">&quot;=&amp;r&quot;</span>(a)</div><div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;            :<span class="stringliteral">&quot;0&quot;</span>(a),<span class="stringliteral">&quot;r&quot;</span>(b)</div><div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;            :<span class="stringliteral">&quot;r14&quot;</span>,<span class="stringliteral">&quot;r15&quot;</span>,<span class="stringliteral">&quot;r16&quot;</span></div><div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;        );</div><div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;        <span class="keywordflow">return</span> a;</div><div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160;        <span class="keywordflow">return</span> a/b;</div><div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;    }</div><div class="line"><a name="l00376"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a964955ed60ab504fa644e969b2a84734">  376</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_h_a_l.html#a964955ed60ab504fa644e969b2a84734">U16SquaredToU32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> val)</div><div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;    {</div><div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;        <span class="keywordtype">long</span> res;</div><div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;        __asm__ __volatile__ ( <span class="comment">// 15 Ticks</span></div><div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;            <span class="stringliteral">&quot;mul %A1,%A1 \n\t&quot;</span></div><div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;            <span class="stringliteral">&quot;movw %A0,r0 \n\t&quot;</span></div><div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160;            <span class="stringliteral">&quot;mul %B1,%B1 \n\t&quot;</span></div><div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;            <span class="stringliteral">&quot;movw %C0,r0 \n\t&quot;</span></div><div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;            <span class="stringliteral">&quot;mul %A1,%B1 \n\t&quot;</span></div><div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;            <span class="stringliteral">&quot;clr %A1 \n\t&quot;</span></div><div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;            <span class="stringliteral">&quot;adc %C0,r1 \n\t&quot;</span></div><div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            <span class="stringliteral">&quot;adc %D0,%A1 \n\t&quot;</span></div><div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;            <span class="stringliteral">&quot;adc %C0,r1 \n\t&quot;</span></div><div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;            <span class="stringliteral">&quot;adc %D0,%A1 \n\t&quot;</span></div><div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;            <span class="stringliteral">&quot;clr r1 \n\t&quot;</span></div><div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;            : <span class="stringliteral">&quot;=&amp;r&quot;</span>(res),<span class="stringliteral">&quot;=r&quot;</span>(val)</div><div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;            : <span class="stringliteral">&quot;1&quot;</span>(val)</div><div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;        );</div><div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;        <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;    }</div><div class="line"><a name="l00398"></a><span class="lineno"><a class="line" href="class_h_a_l.html#aa018bc25f18290bdbca1560657e78028">  398</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_h_a_l.html#aa018bc25f18290bdbca1560657e78028">ComputeV</a>(<span class="keywordtype">long</span> timer,<span class="keywordtype">long</span> accel)</div><div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;    {</div><div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;<span class="preprocessor">#if CPU_ARCH==ARCH_AVR</span></div><div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> res;</div><div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;        <span class="comment">// 38 Ticks</span></div><div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;        __asm__ __volatile__ ( <span class="comment">// 0 = res, 1 = timer, 2 = accel %D2=0 ,%A1 are unused is free</span></div><div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;            <span class="comment">// Result LSB first: %A0, %B0, %A1</span></div><div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;            <span class="stringliteral">&quot;mul %B1,%A2 \n\t&quot;</span></div><div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;            <span class="stringliteral">&quot;mov %A0,r1 \n\t&quot;</span></div><div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            <span class="stringliteral">&quot;mul %B1,%C2 \n\t&quot;</span></div><div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160;            <span class="stringliteral">&quot;mov %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;            <span class="stringliteral">&quot;mov %A1,r1 \n\t&quot;</span></div><div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;            <span class="stringliteral">&quot;mul %B1,%B2 \n\t&quot;</span></div><div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;            <span class="stringliteral">&quot;add %A0,r0 \n\t&quot;</span></div><div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;            <span class="stringliteral">&quot;adc %B0,r1 \n\t&quot;</span></div><div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;            <span class="stringliteral">&quot;adc %A1,%D2 \n\t&quot;</span></div><div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160;            <span class="stringliteral">&quot;mul %C1,%A2 \n\t&quot;</span></div><div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;            <span class="stringliteral">&quot;add %A0,r0 \n\t&quot;</span></div><div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;            <span class="stringliteral">&quot;adc %B0,r1 \n\t&quot;</span></div><div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;            <span class="stringliteral">&quot;adc %A1,%D2 \n\t&quot;</span></div><div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160;            <span class="stringliteral">&quot;mul %C1,%B2 \n\t&quot;</span></div><div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;            <span class="stringliteral">&quot;adc %A1,r1 \n\t&quot;</span></div><div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160;            <span class="stringliteral">&quot;mul %D1,%A2 \n\t&quot;</span></div><div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160;            <span class="stringliteral">&quot;adc %A1,r1 \n\t&quot;</span></div><div class="line"><a name="l00424"></a><span class="lineno">  424</span>&#160;            <span class="stringliteral">&quot;mul %C1,%C2 \n\t&quot;</span></div><div class="line"><a name="l00425"></a><span class="lineno">  425</span>&#160;            <span class="stringliteral">&quot;add %A1,r0 \n\t&quot;</span></div><div class="line"><a name="l00426"></a><span class="lineno">  426</span>&#160;            <span class="stringliteral">&quot;mul %D1,%B2 \n\t&quot;</span></div><div class="line"><a name="l00427"></a><span class="lineno">  427</span>&#160;            <span class="stringliteral">&quot;add %A1,r0 \n\t&quot;</span></div><div class="line"><a name="l00428"></a><span class="lineno">  428</span>&#160;            <span class="stringliteral">&quot;lsr %A1 \n\t&quot;</span></div><div class="line"><a name="l00429"></a><span class="lineno">  429</span>&#160;            <span class="stringliteral">&quot;ror %B0 \n\t&quot;</span></div><div class="line"><a name="l00430"></a><span class="lineno">  430</span>&#160;            <span class="stringliteral">&quot;ror %A0 \n\t&quot;</span></div><div class="line"><a name="l00431"></a><span class="lineno">  431</span>&#160;            <span class="stringliteral">&quot;lsr %A1 \n\t&quot;</span></div><div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;            <span class="stringliteral">&quot;ror %B0 \n\t&quot;</span></div><div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;            <span class="stringliteral">&quot;ror %A0 \n\t&quot;</span></div><div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;            <span class="stringliteral">&quot;clr r1 \n\t&quot;</span></div><div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;            :<span class="stringliteral">&quot;=&amp;r&quot;</span>(res),<span class="stringliteral">&quot;=r&quot;</span>(timer),<span class="stringliteral">&quot;=r&quot;</span>(accel)</div><div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;            :<span class="stringliteral">&quot;1&quot;</span>(timer),<span class="stringliteral">&quot;2&quot;</span>(accel)</div><div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;            : );</div><div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160;        <span class="comment">// unsigned int v = ((timer&gt;&gt;8)*cur-&gt;accel)&gt;&gt;10;</span></div><div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;        <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;        <span class="keywordflow">return</span> ((timer &gt;&gt; 8) * accel) &gt;&gt; 10;</div><div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;    }</div><div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;<span class="comment">// Multiply two 16 bit values and return 32 bit result</span></div><div class="line"><a name="l00445"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ae504c54e23bc159155c56855cb256a36">  445</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> uint32_t <a class="code" href="class_h_a_l.html#ae504c54e23bc159155c56855cb256a36">mulu16xu16to32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> a,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> b)</div><div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;    {</div><div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;        uint32_t res;</div><div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160;        <span class="comment">// 18 Ticks = 1.125 us</span></div><div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;        __asm__ __volatile__ ( <span class="comment">// 0 = res, 1 = timer, 2 = accel %D2=0 ,%A1 are unused is free</span></div><div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;            <span class="comment">// Result LSB first: %A0, %B0, %A1</span></div><div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;            <span class="stringliteral">&quot;clr r18 \n\t&quot;</span></div><div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;            <span class="stringliteral">&quot;mul %B2,%B1 \n\t&quot;</span> <span class="comment">// mul hig bytes</span></div><div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;            <span class="stringliteral">&quot;movw %C0,r0 \n\t&quot;</span></div><div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;            <span class="stringliteral">&quot;mul %A1,%A2 \n\t&quot;</span> <span class="comment">// mul low bytes</span></div><div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;            <span class="stringliteral">&quot;movw %A0,r0 \n\t&quot;</span></div><div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160;            <span class="stringliteral">&quot;mul %A1,%B2 \n\t&quot;</span></div><div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;            <span class="stringliteral">&quot;adc %C0,r1 \n\t&quot;</span></div><div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;            <span class="stringliteral">&quot;adc %D0,r18 \n\t&quot;</span></div><div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;            <span class="stringliteral">&quot;mul %B1,%A2 \n\t&quot;</span></div><div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;            <span class="stringliteral">&quot;add %B0,r0 \n\t&quot;</span></div><div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;            <span class="stringliteral">&quot;adc %C0,r1 \n\t&quot;</span></div><div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;            <span class="stringliteral">&quot;adc %D0,r18 \n\t&quot;</span></div><div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;            <span class="stringliteral">&quot;clr r1 \n\t&quot;</span></div><div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160;            :<span class="stringliteral">&quot;=&amp;r&quot;</span>(res),<span class="stringliteral">&quot;=r&quot;</span>(a),<span class="stringliteral">&quot;=r&quot;</span>(b)</div><div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;            :<span class="stringliteral">&quot;1&quot;</span>(a),<span class="stringliteral">&quot;2&quot;</span>(b)</div><div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;            :<span class="stringliteral">&quot;r18&quot;</span> );</div><div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160;        <span class="comment">// return (long)a*b;</span></div><div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;        <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;    }</div><div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;<span class="comment">// Multiply two 16 bit values and return 32 bit result</span></div><div class="line"><a name="l00472"></a><span class="lineno"><a class="line" href="class_h_a_l.html#af802bafb9205906a50047a1094ce1150">  472</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_h_a_l.html#af802bafb9205906a50047a1094ce1150">mulu6xu16shift16</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> a,<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> b)</div><div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;    {</div><div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;<span class="preprocessor">#if CPU_ARCH == ARCH_AVR</span></div><div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;        <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> res;</div><div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;        <span class="comment">// 18 Ticks = 1.125 us</span></div><div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        __asm__ __volatile__ ( <span class="comment">// 0 = res, 1 = timer, 2 = accel %D2=0 ,%A1 are unused is free</span></div><div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160;            <span class="comment">// Result LSB first: %A0, %B0, %A1</span></div><div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;            <span class="stringliteral">&quot;clr r18 \n\t&quot;</span></div><div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;            <span class="stringliteral">&quot;mul %B2,%B1 \n\t&quot;</span> <span class="comment">// mul hig bytes</span></div><div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;            <span class="stringliteral">&quot;movw %A0,r0 \n\t&quot;</span></div><div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;            <span class="stringliteral">&quot;mul %A1,%A2 \n\t&quot;</span> <span class="comment">// mul low bytes</span></div><div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;            <span class="stringliteral">&quot;mov r19,r1 \n\t&quot;</span></div><div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160;            <span class="stringliteral">&quot;mul %A1,%B2 \n\t&quot;</span></div><div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;            <span class="stringliteral">&quot;add r19,r0 \n\t&quot;</span></div><div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;            <span class="stringliteral">&quot;adc %A0,r1 \n\t&quot;</span></div><div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;            <span class="stringliteral">&quot;adc %B0,r18 \n\t&quot;</span></div><div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;            <span class="stringliteral">&quot;mul %B1,%A2 \n\t&quot;</span></div><div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;            <span class="stringliteral">&quot;add r19,r0 \n\t&quot;</span></div><div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;            <span class="stringliteral">&quot;adc %A0,r1 \n\t&quot;</span></div><div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;            <span class="stringliteral">&quot;adc %B0,r18 \n\t&quot;</span></div><div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;            <span class="stringliteral">&quot;clr r1 \n\t&quot;</span></div><div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;            :<span class="stringliteral">&quot;=&amp;r&quot;</span>(res),<span class="stringliteral">&quot;=r&quot;</span>(a),<span class="stringliteral">&quot;=r&quot;</span>(b)</div><div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160;            :<span class="stringliteral">&quot;1&quot;</span>(a),<span class="stringliteral">&quot;2&quot;</span>(b)</div><div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;            :<span class="stringliteral">&quot;r18&quot;</span>,<span class="stringliteral">&quot;r19&quot;</span> );</div><div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;        <span class="keywordflow">return</span> res;</div><div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        <span class="keywordflow">return</span> ((int32_t)a * b) &gt;&gt; 16;</div><div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160;    }</div><div class="line"><a name="l00501"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a86625dc0b28afa4b131e70529ad9bf8c">  501</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a86625dc0b28afa4b131e70529ad9bf8c">digitalWrite</a>(uint8_t pin,uint8_t value)</div><div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;    {</div><div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;        ::digitalWrite(pin,value);</div><div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;    }</div><div class="line"><a name="l00505"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a559279e2e1003b2d235a98c862cff642">  505</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code" href="class_h_a_l.html#a559279e2e1003b2d235a98c862cff642">digitalRead</a>(uint8_t pin)</div><div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;    {</div><div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160;        return ::digitalRead(pin);</div><div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;    }</div><div class="line"><a name="l00509"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a721b2765f2dcb2a8a4f5fea28d551136">  509</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a721b2765f2dcb2a8a4f5fea28d551136">pinMode</a>(uint8_t pin,uint8_t mode)</div><div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;    {</div><div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;        ::pinMode(pin,mode);</div><div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;    }</div><div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;    <span class="keyword">static</span> int32_t CPUDivU2(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> divisor);</div><div class="line"><a name="l00514"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a55b098463a975b7eaad112512fcc4412">  514</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a55b098463a975b7eaad112512fcc4412">delayMicroseconds</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> delayUs)</div><div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160;    {</div><div class="line"><a name="l00516"></a><span class="lineno">  516</span>&#160;        ::delayMicroseconds(delayUs);</div><div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160;    }</div><div class="line"><a name="l00518"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ae7c155c72a9445bdda01c60e64bb2108">  518</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#ae7c155c72a9445bdda01c60e64bb2108">delayMilliseconds</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> delayMs)</div><div class="line"><a name="l00519"></a><span class="lineno">  519</span>&#160;    {</div><div class="line"><a name="l00520"></a><span class="lineno">  520</span>&#160;        ::delay(delayMs);</div><div class="line"><a name="l00521"></a><span class="lineno">  521</span>&#160;    }</div><div class="line"><a name="l00522"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ad0270c5521b937d841fbc964326503bb">  522</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#ad0270c5521b937d841fbc964326503bb">tone</a>(uint8_t pin,<span class="keywordtype">int</span> duration)</div><div class="line"><a name="l00523"></a><span class="lineno">  523</span>&#160;    {</div><div class="line"><a name="l00524"></a><span class="lineno">  524</span>&#160;        ::tone(pin,duration);</div><div class="line"><a name="l00525"></a><span class="lineno">  525</span>&#160;    }</div><div class="line"><a name="l00526"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a67ab4c0165c9c9d90bf3e0f231ba3b59">  526</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a67ab4c0165c9c9d90bf3e0f231ba3b59">noTone</a>(uint8_t pin)</div><div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    {</div><div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;        ::noTone(pin);</div><div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;    }</div><div class="line"><a name="l00530"></a><span class="lineno"><a class="line" href="class_h_a_l.html#aef854d58f64fc3f20e11bd76c331f287">  530</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#aef854d58f64fc3f20e11bd76c331f287">eprSetByte</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos,uint8_t value)</div><div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;    {</div><div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;        eeprom_write_byte((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos), value);</div><div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;    }</div><div class="line"><a name="l00534"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a5890acd2f9a8e5880e018747de54c470">  534</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a5890acd2f9a8e5880e018747de54c470">eprSetInt16</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos,int16_t value)</div><div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160;    {</div><div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;        eeprom_write_word((<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>*)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos),value);</div><div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;    }</div><div class="line"><a name="l00538"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a5cae8bbfb20d624ffac8bb13ca8e82d6">  538</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a5cae8bbfb20d624ffac8bb13ca8e82d6">eprSetInt32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos,int32_t value)</div><div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;    {</div><div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;        eeprom_write_dword((uint32_t*)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos),value);</div><div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;    }</div><div class="line"><a name="l00542"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a77143b2603f23039ac1ccf3e19da2276">  542</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a77143b2603f23039ac1ccf3e19da2276">eprSetFloat</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos,<span class="keywordtype">float</span> value)</div><div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;    {</div><div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;        eeprom_write_block(&amp;value,(<span class="keywordtype">void</span>*)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos), 4);</div><div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;    }</div><div class="line"><a name="l00546"></a><span class="lineno"><a class="line" href="class_h_a_l.html#aa0c589f123ad1c374ac7a2ccaf1c070f">  546</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code" href="class_h_a_l.html#aa0c589f123ad1c374ac7a2ccaf1c070f">eprGetByte</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos)</div><div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;    {</div><div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;        <span class="keywordflow">return</span> eeprom_read_byte ((<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos));</div><div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;    }</div><div class="line"><a name="l00550"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ace04b3aa82abcaf7cefcbcd25af2d785">  550</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> int16_t <a class="code" href="class_h_a_l.html#ace04b3aa82abcaf7cefcbcd25af2d785">eprGetInt16</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos)</div><div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160;    {</div><div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160;        <span class="keywordflow">return</span> eeprom_read_word((uint16_t *)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos));</div><div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;    }</div><div class="line"><a name="l00554"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ade8a4a3ba02d862eb7e179438f222651">  554</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> int32_t <a class="code" href="class_h_a_l.html#ade8a4a3ba02d862eb7e179438f222651">eprGetInt32</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos)</div><div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;    {</div><div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;        <span class="keywordflow">return</span> eeprom_read_dword((uint32_t*)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos));</div><div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;    }</div><div class="line"><a name="l00558"></a><span class="lineno"><a class="line" href="class_h_a_l.html#adcecd0c9a62886a2a82d14ba311690ac">  558</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="class_h_a_l.html#adcecd0c9a62886a2a82d14ba311690ac">eprGetFloat</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> pos)</div><div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;    {</div><div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;        <span class="keywordtype">float</span> v;</div><div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;        eeprom_read_block(&amp;v,(<span class="keywordtype">void</span> *)(<a class="code" href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a> + pos),4); <span class="comment">// newer gcc have eeprom_read_block but not arduino 22</span></div><div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160;        <span class="keywordflow">return</span> v;</div><div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;    }</div><div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;</div><div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;    <span class="comment">// Faster version of InterruptProtectedBlock.</span></div><div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;    <span class="comment">// For safety it ma yonly be called from within an</span></div><div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;    <span class="comment">// interrupt handler.</span></div><div class="line"><a name="l00568"></a><span class="lineno"><a class="line" href="class_h_a_l.html#aad1e2ee3a56414df8328a9fc5cbfe6e4">  568</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#aad1e2ee3a56414df8328a9fc5cbfe6e4">allowInterrupts</a>()</div><div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;    {</div><div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;        sei();</div><div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160;    }</div><div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;</div><div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;    <span class="comment">// Faster version of InterruptProtectedBlock.</span></div><div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160;    <span class="comment">// For safety it may only be called from within an</span></div><div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;    <span class="comment">// interrupt handler.</span></div><div class="line"><a name="l00576"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a56d49442ce5f9d581523326bcd39dd6c">  576</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a56d49442ce5f9d581523326bcd39dd6c">forbidInterrupts</a>()</div><div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160;    {</div><div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;        cli();</div><div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;    }</div><div class="line"><a name="l00580"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a79bb8432046f87a7bef3a966ed639ba0">  580</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="_h_a_l_8h.html#a5f255edd429b0abc92fae25c511d45a7">millis_t</a> <a class="code" href="class_h_a_l.html#a79bb8432046f87a7bef3a966ed639ba0">timeInMilliseconds</a>()</div><div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;    {</div><div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160;        <span class="keywordflow">return</span> millis();</div><div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;    }</div><div class="line"><a name="l00584"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a6b480420252382f23bd571ff5d6151ff">  584</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">char</span> <a class="code" href="class_h_a_l.html#a6b480420252382f23bd571ff5d6151ff">readFlashByte</a>(PGM_P ptr)</div><div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;    {</div><div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;        <span class="keywordflow">return</span> pgm_read_byte(ptr);</div><div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;    }</div><div class="line"><a name="l00588"></a><span class="lineno"><a class="line" href="class_h_a_l.html#abe5c809102eb9d2ae53deafba5f15fbe">  588</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> int16_t <a class="code" href="class_h_a_l.html#abe5c809102eb9d2ae53deafba5f15fbe">readFlashWord</a>(PGM_P ptr)</div><div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;    {</div><div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;        <span class="keywordflow">return</span> pgm_read_word(ptr);</div><div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160;    }</div><div class="line"><a name="l00592"></a><span class="lineno"><a class="line" href="class_h_a_l.html#af84f5b093f470d54ea68c91f763c8a6c">  592</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#af84f5b093f470d54ea68c91f763c8a6c">serialSetBaudrate</a>(<span class="keywordtype">long</span> baud)</div><div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;    {</div><div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;        <a class="code" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a>.begin(baud);</div><div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;    }</div><div class="line"><a name="l00596"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a9fabb6946e5c0d77b74f3068c4b11d32">  596</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_h_a_l.html#a9fabb6946e5c0d77b74f3068c4b11d32">serialByteAvailable</a>()</div><div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    {</div><div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a>.available() &gt; 0;</div><div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    }</div><div class="line"><a name="l00600"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a27bfa56b04faef588f8e20688ccaac0b">  600</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code" href="class_h_a_l.html#a27bfa56b04faef588f8e20688ccaac0b">serialReadByte</a>()</div><div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160;    {</div><div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a>.read();</div><div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;    }</div><div class="line"><a name="l00604"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a5b72954f16d050f2510cc9bf19a71996">  604</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a5b72954f16d050f2510cc9bf19a71996">serialWriteByte</a>(<span class="keywordtype">char</span> b)</div><div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;    {</div><div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;        <a class="code" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a>.write(b);</div><div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;    }</div><div class="line"><a name="l00608"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a47b2e7af785eccd67dc61efc9dd62d88">  608</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a47b2e7af785eccd67dc61efc9dd62d88">serialFlush</a>()</div><div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160;    {</div><div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;        <a class="code" href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a>.flush();</div><div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;    }</div><div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> setupTimer();</div><div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> showStartReason();</div><div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">int</span> getFreeRam();</div><div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> resetHardware();</div><div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;</div><div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;    <span class="comment">// SPI related functions</span></div><div class="line"><a name="l00618"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a589acc269001f4059a5f680ad1246f1a">  618</a></span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a589acc269001f4059a5f680ad1246f1a">spiBegin</a>()</div><div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;    {</div><div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160;<span class="preprocessor">#if SDSS &gt;= 0</span></div><div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;        <a class="code" href="fastio_8h.html#afa76df25ccdb2d113a057c8c305399cc">SET_INPUT</a>(MISO_PIN);</div><div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(MOSI_PIN);</div><div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(SCK_PIN);</div><div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;        <span class="comment">// SS must be in output mode even it is not chip select</span></div><div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(<a class="code" href="_display_list_8h.html#ace91a4e928d61240785c9438be8651d0">SDSS</a>);</div><div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160;<span class="preprocessor">#if SDSSORIG &gt;- 1</span></div><div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(<a class="code" href="pins_8h.html#aa99223caee7fa53b583f2b367cc665fc">SDSSORIG</a>);</div><div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160;        <span class="comment">// set SS high - may be chip select for another SPI device</span></div><div class="line"><a name="l00630"></a><span class="lineno">  630</span>&#160;<span class="preprocessor">#if defined(SET_SPI_SS_HIGH) &amp;&amp; SET_SPI_SS_HIGH</span></div><div class="line"><a name="l00631"></a><span class="lineno">  631</span>&#160;        <a class="code" href="fastio_8h.html#a3d38c0667426652d3fa2eb62f23e1591">WRITE</a>(<a class="code" href="_display_list_8h.html#ace91a4e928d61240785c9438be8651d0">SDSS</a>, HIGH);</div><div class="line"><a name="l00632"></a><span class="lineno">  632</span>&#160;<span class="preprocessor">#endif  // SET_SPI_SS_HIGH</span></div><div class="line"><a name="l00633"></a><span class="lineno">  633</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00634"></a><span class="lineno">  634</span>&#160;    }</div><div class="line"><a name="l00635"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a1c5c73cce4de042f619208d4614adfa9">  635</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a1c5c73cce4de042f619208d4614adfa9">spiInit</a>(uint8_t spiRate)</div><div class="line"><a name="l00636"></a><span class="lineno">  636</span>&#160;    {</div><div class="line"><a name="l00637"></a><span class="lineno">  637</span>&#160;         uint8_t r = 0;</div><div class="line"><a name="l00638"></a><span class="lineno">  638</span>&#160;         <span class="keywordflow">for</span> (uint8_t b = 2; spiRate &gt; b &amp;&amp; r &lt; 6; b &lt;&lt;= 1, r++);</div><div class="line"><a name="l00639"></a><span class="lineno">  639</span>&#160;</div><div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(SS);</div><div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;        <a class="code" href="fastio_8h.html#a3d38c0667426652d3fa2eb62f23e1591">WRITE</a>(SS,HIGH);</div><div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(SCK);</div><div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;        <a class="code" href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a>(MOSI_PIN);</div><div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160;        <a class="code" href="fastio_8h.html#afa76df25ccdb2d113a057c8c305399cc">SET_INPUT</a>(MISO_PIN);</div><div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;<span class="preprocessor">#ifdef  PRR</span></div><div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;        PRR &amp;= ~(1&lt;&lt;PRSPI);</div><div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160;<span class="preprocessor">#elif defined PRR0</span></div><div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160;        PRR0 &amp;= ~(1&lt;&lt;PRSPI);</div><div class="line"><a name="l00649"></a><span class="lineno">  649</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00650"></a><span class="lineno">  650</span>&#160;        <span class="comment">// See avr processor documentation</span></div><div class="line"><a name="l00651"></a><span class="lineno">  651</span>&#160;        SPCR = (1 &lt;&lt; SPE) | (1 &lt;&lt; MSTR) | (r &gt;&gt; 1);</div><div class="line"><a name="l00652"></a><span class="lineno">  652</span>&#160;        SPSR = (r &amp; 1 || r == 6 ? 0 : 1) &lt;&lt; SPI2X;</div><div class="line"><a name="l00653"></a><span class="lineno">  653</span>&#160;</div><div class="line"><a name="l00654"></a><span class="lineno">  654</span>&#160;    }</div><div class="line"><a name="l00655"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ab37f5171c44e3504aa1135a20643a559">  655</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> uint8_t <a class="code" href="class_h_a_l.html#ab37f5171c44e3504aa1135a20643a559">spiReceive</a>(uint8_t send=0xff)</div><div class="line"><a name="l00656"></a><span class="lineno">  656</span>&#160;    {</div><div class="line"><a name="l00657"></a><span class="lineno">  657</span>&#160;        SPDR = send;</div><div class="line"><a name="l00658"></a><span class="lineno">  658</span>&#160;        <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;        <span class="keywordflow">return</span> SPDR;</div><div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;    }</div><div class="line"><a name="l00661"></a><span class="lineno"><a class="line" href="class_h_a_l.html#aa57e04102fc3c5df107def4f5477770c">  661</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#aa57e04102fc3c5df107def4f5477770c">spiReadBlock</a>(uint8_t*buf,<span class="keywordtype">size_t</span> nbyte)</div><div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;    {</div><div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;        <span class="keywordflow">if</span> (nbyte-- == 0) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;        SPDR = 0XFF;</div><div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; nbyte; i++)</div><div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;        {</div><div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;            <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;            buf[i] = SPDR;</div><div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;            SPDR = 0XFF;</div><div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;        }</div><div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;        <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;        buf[nbyte] = SPDR;</div><div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;    }</div><div class="line"><a name="l00674"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a026dc6114ef4ca8705fd5e5f14bcca2c">  674</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a026dc6114ef4ca8705fd5e5f14bcca2c">spiSend</a>(uint8_t b)</div><div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;    {</div><div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160;        SPDR = b;</div><div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;        <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;    }</div><div class="line"><a name="l00679"></a><span class="lineno"><a class="line" href="class_h_a_l.html#af6fb18a37ead3afae5362ecbae7ee08d">  679</a></span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#af6fb18a37ead3afae5362ecbae7ee08d">spiSend</a>(<span class="keyword">const</span> uint8_t* buf , <span class="keywordtype">size_t</span> n)</div><div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;    {</div><div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;        <span class="keywordflow">if</span> (n == 0) <span class="keywordflow">return</span>;</div><div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;        SPDR = buf[0];</div><div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;        <span class="keywordflow">if</span> (n &gt; 1)</div><div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;        {</div><div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;            uint8_t b = buf[1];</div><div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;            <span class="keywordtype">size_t</span> i = 2;</div><div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;            <span class="keywordflow">while</span> (1)</div><div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;            {</div><div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;                <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;                SPDR = b;</div><div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;                <span class="keywordflow">if</span> (i == n) <span class="keywordflow">break</span>;</div><div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;                b = buf[i++];</div><div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;            }</div><div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;        }</div><div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;        <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;    }</div><div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;</div><div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;    <span class="keyword">static</span> <span class="keyword">inline</span> <a class="code" href="_h_a_l_8cpp.html#a73fea6a0baf160327564ce5b4110d099">__attribute__</a>((always_inline))</div><div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;    <span class="keywordtype">void</span> spiSendBlock(uint8_t token, <span class="keyword">const</span> uint8_t* buf)</div><div class="line"><a name="l00700"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a520924d4d33b91d410df52f4c8f0b0ea">  700</a></span>&#160;    {</div><div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160;        SPDR = token;</div><div class="line"><a name="l00702"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ace1d4a80ee896cab05d74d6b279fe1ea">  702</a></span>&#160;        <span class="keywordflow">for</span> (uint16_t i = 0; i &lt; 512; i += 2)</div><div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;        {</div><div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;            <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;            SPDR = buf[i];</div><div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;            <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;            SPDR = buf[i + 1];</div><div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;        }</div><div class="line"><a name="l00709"></a><span class="lineno"><a class="line" href="class_h_a_l.html#af838c67588663890a873d1b0cae9c30c">  709</a></span>&#160;        <span class="keywordflow">while</span> (!(SPSR &amp; (1 &lt;&lt; SPIF))) {}</div><div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160;    }</div><div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;</div><div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;    <span class="comment">// I2C Support</span></div><div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;</div><div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;        <span class="keyword">static</span> <span class="keywordtype">void</span> i2cSetClockspeed(uint32_t clockSpeedHz);</div><div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> i2cInit(uint32_t clockSpeedHz);</div><div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> i2cStart(uint8_t address);</div><div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> i2cStartWait(uint8_t address);</div><div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> i2cStop(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> i2cWrite( uint8_t data );</div><div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;    <span class="keyword">static</span> uint8_t i2cReadAck(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;    <span class="keyword">static</span> uint8_t i2cReadNak(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;</div><div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;    <span class="comment">// Watchdog support</span></div><div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;</div><div class="line"><a name="l00725"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a6b50afc76ddf19c9b13a7405ca73039e">  725</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a6b50afc76ddf19c9b13a7405ca73039e">startWatchdog</a>()</div><div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;    {</div><div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;<span class="preprocessor">#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)</span></div><div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;        WDTCSR = (1&lt;&lt;WDCE) | (1&lt;&lt;WDE);                                                          <span class="comment">// wdt FIX for arduino mega boards</span></div><div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;        WDTCSR = (1&lt;&lt;WDIE) | (1&lt;&lt;WDP3);</div><div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160;<span class="preprocessor">#else</span></div><div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;        wdt_enable(WDTO_4S);</div><div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;    };</div><div class="line"><a name="l00734"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a0f699472c569705aa31dd0be7f129edc">  734</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a0f699472c569705aa31dd0be7f129edc">stopWatchdog</a>()</div><div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;    {</div><div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;        wdt_disable();</div><div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;    }</div><div class="line"><a name="l00738"></a><span class="lineno"><a class="line" href="class_h_a_l.html#a813840b3280404295971569920309215">  738</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="class_h_a_l.html#a813840b3280404295971569920309215">pingWatchdog</a>()</div><div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    {</div><div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;<span class="preprocessor">#if FEATURE_WATCHDOG</span></div><div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;      wdPinged = <span class="keyword">true</span>;</div><div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;    };</div><div class="line"><a name="l00744"></a><span class="lineno"><a class="line" href="class_h_a_l.html#ab068dbc39243d7465e51dfc8452de2d7">  744</a></span>&#160;    <span class="keyword">inline</span> <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="class_h_a_l.html#ab068dbc39243d7465e51dfc8452de2d7">maxExtruderTimerFrequency</a>()</div><div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;    {</div><div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;        <span class="keywordflow">return</span> (<span class="keywordtype">float</span>)F_CPU/<a class="code" href="_h_a_l_8h.html#a806ea970ccbc3c57a4d4ad45dbbb4725">TIMER0_PRESCALE</a>;</div><div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;    }</div><div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;<span class="preprocessor">#if FEATURE_SERVO</span></div><div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> servoTimings[4];</div><div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> servoMicroseconds(uint8_t servo,<span class="keywordtype">int</span> ms, uint16_t autoOff);</div><div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> analogStart();</div><div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;<span class="preprocessor">#if USE_ADVANCE</span></div><div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> resetExtruderDirection();</div><div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;<span class="keyword">private</span>:</div><div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;};</div><div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;<span class="comment">/*#if MOTHERBOARD==6 || MOTHERBOARD==62 || MOTHERBOARD==7</span></div><div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="comment">#if MOTHERBOARD!=7</span></div><div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;<span class="comment">#define SIMULATE_PWM</span></div><div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160;<span class="comment">#endif</span></div><div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;<span class="comment">#define EXTRUDER_TIMER_VECTOR TIMER2_COMPA_vect</span></div><div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;<span class="comment">#define EXTRUDER_OCR OCR2A</span></div><div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;<span class="comment">#define EXTRUDER_TCCR TCCR2A</span></div><div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;<span class="comment">#define EXTRUDER_TIMSK TIMSK2</span></div><div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;<span class="comment">#define EXTRUDER_OCIE OCIE2A</span></div><div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;<span class="comment">#define PWM_TIMER_VECTOR TIMER2_COMPB_vect</span></div><div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;<span class="comment">#define PWM_OCR OCR2B</span></div><div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;<span class="comment">#define PWM_TCCR TCCR2B</span></div><div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;<span class="comment">#define PWM_TIMSK TIMSK2</span></div><div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;<span class="comment">#define PWM_OCIE OCIE2B</span></div><div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;<span class="comment">#else*/</span></div><div class="line"><a name="l00774"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a5493104832094f07b22a464e74bd27e5">  774</a></span>&#160;<span class="preprocessor">#define EXTRUDER_TIMER_VECTOR TIMER0_COMPA_vect</span></div><div class="line"><a name="l00775"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ab2ee6e3d51e61ad0bb6b3cad752d370f">  775</a></span>&#160;<span class="preprocessor">#define EXTRUDER_OCR OCR0A</span></div><div class="line"><a name="l00776"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#ac42ca5d0c9feeea62388c90bdbefb07e">  776</a></span>&#160;<span class="preprocessor">#define EXTRUDER_TCCR TCCR0A</span></div><div class="line"><a name="l00777"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a79f67c6e1d741eaa6031589fe1d5541c">  777</a></span>&#160;<span class="preprocessor">#define EXTRUDER_TIMSK TIMSK0</span></div><div class="line"><a name="l00778"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#aba2d8b413b09fbcd79663a684e0f2a37">  778</a></span>&#160;<span class="preprocessor">#define EXTRUDER_OCIE OCIE0A</span></div><div class="line"><a name="l00779"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a0ad5f01af339a57de4bd2a3531300d18">  779</a></span>&#160;<span class="preprocessor">#define PWM_TIMER_VECTOR TIMER0_COMPB_vect</span></div><div class="line"><a name="l00780"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a52bf5f75ac47d9f19ac0b732aaccbefa">  780</a></span>&#160;<span class="preprocessor">#define PWM_OCR OCR0B</span></div><div class="line"><a name="l00781"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a6942ce3f11c17a2e79db0615f8c590ac">  781</a></span>&#160;<span class="preprocessor">#define PWM_TCCR TCCR0A</span></div><div class="line"><a name="l00782"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a5b1f41fba5eb7c7b9f73803341f1b864">  782</a></span>&#160;<span class="preprocessor">#define PWM_TIMSK TIMSK0</span></div><div class="line"><a name="l00783"></a><span class="lineno"><a class="line" href="_h_a_l_8h.html#a25524bb70fb55ea5dd84979ad623e078">  783</a></span>&#160;<span class="preprocessor">#define PWM_OCIE OCIE0B</span></div><div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;<span class="comment">//#endif</span></div><div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;<span class="preprocessor">#endif // HAL_H</span></div><div class="ttc" id="class_h_a_l_html_ace04b3aa82abcaf7cefcbcd25af2d785"><div class="ttname"><a href="class_h_a_l.html#ace04b3aa82abcaf7cefcbcd25af2d785">HAL::eprGetInt16</a></div><div class="ttdeci">static int16_t eprGetInt16(unsigned int pos)</div><div class="ttdef"><b>Definition:</b> HAL.h:550</div></div>
<div class="ttc" id="class_h_a_l_html_ab068dbc39243d7465e51dfc8452de2d7"><div class="ttname"><a href="class_h_a_l.html#ab068dbc39243d7465e51dfc8452de2d7">HAL::maxExtruderTimerFrequency</a></div><div class="ttdeci">static float maxExtruderTimerFrequency()</div><div class="ttdef"><b>Definition:</b> HAL.h:744</div></div>
<div class="ttc" id="class_h_a_l_html_ab37f5171c44e3504aa1135a20643a559"><div class="ttname"><a href="class_h_a_l.html#ab37f5171c44e3504aa1135a20643a559">HAL::spiReceive</a></div><div class="ttdeci">static uint8_t spiReceive(uint8_t send=0xff)</div><div class="ttdef"><b>Definition:</b> HAL.h:655</div></div>
<div class="ttc" id="_h_a_l_8h_html_af0d9a9a9aac810bf58f698086f76e516"><div class="ttname"><a href="_h_a_l_8h.html#af0d9a9a9aac810bf58f698086f76e516">SERIAL_TX_BUFFER_SIZE</a></div><div class="ttdeci">#define SERIAL_TX_BUFFER_SIZE</div><div class="ttdef"><b>Definition:</b> HAL.h:198</div></div>
<div class="ttc" id="class_h_a_l_html_aad1e2ee3a56414df8328a9fc5cbfe6e4"><div class="ttname"><a href="class_h_a_l.html#aad1e2ee3a56414df8328a9fc5cbfe6e4">HAL::allowInterrupts</a></div><div class="ttdeci">static void allowInterrupts()</div><div class="ttdef"><b>Definition:</b> HAL.h:568</div></div>
<div class="ttc" id="class_h_a_l_html_adcecd0c9a62886a2a82d14ba311690ac"><div class="ttname"><a href="class_h_a_l.html#adcecd0c9a62886a2a82d14ba311690ac">HAL::eprGetFloat</a></div><div class="ttdeci">static float eprGetFloat(unsigned int pos)</div><div class="ttdef"><b>Definition:</b> HAL.h:558</div></div>
<div class="ttc" id="class_h_a_l_html_a86625dc0b28afa4b131e70529ad9bf8c"><div class="ttname"><a href="class_h_a_l.html#a86625dc0b28afa4b131e70529ad9bf8c">HAL::digitalWrite</a></div><div class="ttdeci">static void digitalWrite(uint8_t pin, uint8_t value)</div><div class="ttdef"><b>Definition:</b> HAL.h:501</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a51cc8931325840bea73281ae1f9b440f"><div class="ttname"><a href="class_r_f_hardware_serial.html#a51cc8931325840bea73281ae1f9b440f">RFHardwareSerial::_txen</a></div><div class="ttdeci">uint8_t _txen</div><div class="ttdef"><b>Definition:</b> HAL.h:226</div></div>
<div class="ttc" id="structring__buffer_html_a612d23af97374f5dd9e3c0eab8eadc89"><div class="ttname"><a href="structring__buffer.html#a612d23af97374f5dd9e3c0eab8eadc89">ring_buffer::tail</a></div><div class="ttdeci">volatile uint8_t tail</div><div class="ttdef"><b>Definition:</b> HAL.h:206</div></div>
<div class="ttc" id="class_h_a_l_html_a79bb8432046f87a7bef3a966ed639ba0"><div class="ttname"><a href="class_h_a_l.html#a79bb8432046f87a7bef3a966ed639ba0">HAL::timeInMilliseconds</a></div><div class="ttdeci">static millis_t timeInMilliseconds()</div><div class="ttdef"><b>Definition:</b> HAL.h:580</div></div>
<div class="ttc" id="class_h_a_l_html_ae504c54e23bc159155c56855cb256a36"><div class="ttname"><a href="class_h_a_l.html#ae504c54e23bc159155c56855cb256a36">HAL::mulu16xu16to32</a></div><div class="ttdeci">static uint32_t mulu16xu16to32(unsigned int a, unsigned int b)</div><div class="ttdef"><b>Definition:</b> HAL.h:445</div></div>
<div class="ttc" id="class_h_a_l_html_a27bfa56b04faef588f8e20688ccaac0b"><div class="ttname"><a href="class_h_a_l.html#a27bfa56b04faef588f8e20688ccaac0b">HAL::serialReadByte</a></div><div class="ttdeci">static uint8_t serialReadByte()</div><div class="ttdef"><b>Definition:</b> HAL.h:600</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a77ffe7e3825e50679393ae899660ab3c"><div class="ttname"><a href="class_r_f_hardware_serial.html#a77ffe7e3825e50679393ae899660ab3c">RFHardwareSerial::_udrie</a></div><div class="ttdeci">uint8_t _udrie</div><div class="ttdef"><b>Definition:</b> HAL.h:228</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_aeecf76372c636a0e320c39b52a96ac45"><div class="ttname"><a href="class_r_f_hardware_serial.html#aeecf76372c636a0e320c39b52a96ac45">RFHardwareSerial::_u2x</a></div><div class="ttdeci">uint8_t _u2x</div><div class="ttdef"><b>Definition:</b> HAL.h:229</div></div>
<div class="ttc" id="class_h_a_l_html_a77143b2603f23039ac1ccf3e19da2276"><div class="ttname"><a href="class_h_a_l.html#a77143b2603f23039ac1ccf3e19da2276">HAL::eprSetFloat</a></div><div class="ttdeci">static void eprSetFloat(unsigned int pos, float value)</div><div class="ttdef"><b>Definition:</b> HAL.h:542</div></div>
<div class="ttc" id="_h_a_l_8h_html_a21799deb67a18c9ab43cbcc0b0131c27"><div class="ttname"><a href="_h_a_l_8h.html#a21799deb67a18c9ab43cbcc0b0131c27">flag8_t</a></div><div class="ttdeci">uint8_t flag8_t</div><div class="ttdef"><b>Definition:</b> HAL.h:159</div></div>
<div class="ttc" id="class_h_a_l_html_af802bafb9205906a50047a1094ce1150"><div class="ttname"><a href="class_h_a_l.html#af802bafb9205906a50047a1094ce1150">HAL::mulu6xu16shift16</a></div><div class="ttdeci">static unsigned int mulu6xu16shift16(unsigned int a, unsigned int b)</div><div class="ttdef"><b>Definition:</b> HAL.h:472</div></div>
<div class="ttc" id="class_h_a_l_html_ae7c155c72a9445bdda01c60e64bb2108"><div class="ttname"><a href="class_h_a_l.html#ae7c155c72a9445bdda01c60e64bb2108">HAL::delayMilliseconds</a></div><div class="ttdeci">static void delayMilliseconds(unsigned int delayMs)</div><div class="ttdef"><b>Definition:</b> HAL.h:518</div></div>
<div class="ttc" id="class_interrupt_protected_block_html_a60d6685bf1195357503d24348b7dee97"><div class="ttname"><a href="class_interrupt_protected_block.html#a60d6685bf1195357503d24348b7dee97">InterruptProtectedBlock::unprotect</a></div><div class="ttdeci">void unprotect()</div><div class="ttdef"><b>Definition:</b> HAL.h:112</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a95201b78e2d373b9d862c83cf50d9f7b"><div class="ttname"><a href="class_r_f_hardware_serial.html#a95201b78e2d373b9d862c83cf50d9f7b">RFHardwareSerial::_ubrrl</a></div><div class="ttdeci">volatile uint8_t * _ubrrl</div><div class="ttdef"><b>Definition:</b> HAL.h:221</div></div>
<div class="ttc" id="_h_a_l_8h_html_a80a0874aa42d7783b26fce1ea16f6658"><div class="ttname"><a href="_h_a_l_8h.html#a80a0874aa42d7783b26fce1ea16f6658">speed_t</a></div><div class="ttdeci">uint16_t speed_t</div><div class="ttdef"><b>Definition:</b> HAL.h:156</div></div>
<div class="ttc" id="fastio_8h_html_a3d38c0667426652d3fa2eb62f23e1591"><div class="ttname"><a href="fastio_8h.html#a3d38c0667426652d3fa2eb62f23e1591">WRITE</a></div><div class="ttdeci">#define WRITE(IO, v)</div><div class="ttdoc">Write to a pin wrapper. </div><div class="ttdef"><b>Definition:</b> fastio.h:48</div></div>
<div class="ttc" id="class_h_a_l_html_a026dc6114ef4ca8705fd5e5f14bcca2c"><div class="ttname"><a href="class_h_a_l.html#a026dc6114ef4ca8705fd5e5f14bcca2c">HAL::spiSend</a></div><div class="ttdeci">static void spiSend(uint8_t b)</div><div class="ttdef"><b>Definition:</b> HAL.h:674</div></div>
<div class="ttc" id="class_h_a_l_html_af84f5b093f470d54ea68c91f763c8a6c"><div class="ttname"><a href="class_h_a_l.html#af84f5b093f470d54ea68c91f763c8a6c">HAL::serialSetBaudrate</a></div><div class="ttdeci">static void serialSetBaudrate(long baud)</div><div class="ttdef"><b>Definition:</b> HAL.h:592</div></div>
<div class="ttc" id="class_h_a_l_html"><div class="ttname"><a href="class_h_a_l.html">HAL</a></div><div class="ttdef"><b>Definition:</b> HAL.h:272</div></div>
<div class="ttc" id="class_h_a_l_html_a813840b3280404295971569920309215"><div class="ttname"><a href="class_h_a_l.html#a813840b3280404295971569920309215">HAL::pingWatchdog</a></div><div class="ttdeci">static void pingWatchdog()</div><div class="ttdef"><b>Definition:</b> HAL.h:738</div></div>
<div class="ttc" id="structring__buffer__tx_html"><div class="ttname"><a href="structring__buffer__tx.html">ring_buffer_tx</a></div><div class="ttdef"><b>Definition:</b> HAL.h:208</div></div>
<div class="ttc" id="pins_8h_html_aa99223caee7fa53b583f2b367cc665fc"><div class="ttname"><a href="pins_8h.html#aa99223caee7fa53b583f2b367cc665fc">SDSSORIG</a></div><div class="ttdeci">#define SDSSORIG</div><div class="ttdef"><b>Definition:</b> pins.h:3022</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a079df5a8be5f117e0ec5deafdde02fa2"><div class="ttname"><a href="class_r_f_hardware_serial.html#a079df5a8be5f117e0ec5deafdde02fa2">RFHardwareSerial::_tx_buffer</a></div><div class="ttdeci">ring_buffer_tx * _tx_buffer</div><div class="ttdef"><b>Definition:</b> HAL.h:219</div></div>
<div class="ttc" id="class_h_a_l_html_a964955ed60ab504fa644e969b2a84734"><div class="ttname"><a href="class_h_a_l.html#a964955ed60ab504fa644e969b2a84734">HAL::U16SquaredToU32</a></div><div class="ttdeci">static unsigned long U16SquaredToU32(unsigned int val)</div><div class="ttdef"><b>Definition:</b> HAL.h:376</div></div>
<div class="ttc" id="class_h_a_l_html_a6b480420252382f23bd571ff5d6151ff"><div class="ttname"><a href="class_h_a_l.html#a6b480420252382f23bd571ff5d6151ff">HAL::readFlashByte</a></div><div class="ttdeci">static char readFlashByte(PGM_P ptr)</div><div class="ttdef"><b>Definition:</b> HAL.h:584</div></div>
<div class="ttc" id="class_h_a_l_html_a6b50afc76ddf19c9b13a7405ca73039e"><div class="ttname"><a href="class_h_a_l.html#a6b50afc76ddf19c9b13a7405ca73039e">HAL::startWatchdog</a></div><div class="ttdeci">static void startWatchdog()</div><div class="ttdef"><b>Definition:</b> HAL.h:725</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_aaa49c44c6ae37ac0f72436fe86445abc"><div class="ttname"><a href="class_r_f_hardware_serial.html#aaa49c44c6ae37ac0f72436fe86445abc">RFHardwareSerial::_ucsra</a></div><div class="ttdeci">volatile uint8_t * _ucsra</div><div class="ttdef"><b>Definition:</b> HAL.h:222</div></div>
<div class="ttc" id="class_interrupt_protected_block_html"><div class="ttname"><a href="class_interrupt_protected_block.html">InterruptProtectedBlock</a></div><div class="ttdef"><b>Definition:</b> HAL.h:103</div></div>
<div class="ttc" id="class_h_a_l_html_a559279e2e1003b2d235a98c862cff642"><div class="ttname"><a href="class_h_a_l.html#a559279e2e1003b2d235a98c862cff642">HAL::digitalRead</a></div><div class="ttdeci">static uint8_t digitalRead(uint8_t pin)</div><div class="ttdef"><b>Definition:</b> HAL.h:505</div></div>
<div class="ttc" id="fastio_8h_html_a4bdb8759f0e85e88956ac23262e0916b"><div class="ttname"><a href="fastio_8h.html#a4bdb8759f0e85e88956ac23262e0916b">SET_OUTPUT</a></div><div class="ttdeci">#define SET_OUTPUT(IO)</div><div class="ttdoc">set pin as output wrapper </div><div class="ttdef"><b>Definition:</b> fastio.h:56</div></div>
<div class="ttc" id="class_h_a_l_html_aa0c589f123ad1c374ac7a2ccaf1c070f"><div class="ttname"><a href="class_h_a_l.html#aa0c589f123ad1c374ac7a2ccaf1c070f">HAL::eprGetByte</a></div><div class="ttdeci">static uint8_t eprGetByte(unsigned int pos)</div><div class="ttdef"><b>Definition:</b> HAL.h:546</div></div>
<div class="ttc" id="class_h_a_l_html_a64f198bc017b27419068232d6e7b10c9"><div class="ttname"><a href="class_h_a_l.html#a64f198bc017b27419068232d6e7b10c9">HAL::hwSetup</a></div><div class="ttdeci">static void hwSetup(void)</div><div class="ttdef"><b>Definition:</b> HAL.h:280</div></div>
<div class="ttc" id="class_h_a_l_html_ade8a4a3ba02d862eb7e179438f222651"><div class="ttname"><a href="class_h_a_l.html#ade8a4a3ba02d862eb7e179438f222651">HAL::eprGetInt32</a></div><div class="ttdeci">static int32_t eprGetInt32(unsigned int pos)</div><div class="ttdef"><b>Definition:</b> HAL.h:554</div></div>
<div class="ttc" id="class_h_a_l_html_af6fb18a37ead3afae5362ecbae7ee08d"><div class="ttname"><a href="class_h_a_l.html#af6fb18a37ead3afae5362ecbae7ee08d">HAL::spiSend</a></div><div class="ttdeci">static void spiSend(const uint8_t *buf, size_t n)</div><div class="ttdef"><b>Definition:</b> HAL.h:679</div></div>
<div class="ttc" id="class_h_a_l_html_a1c5c73cce4de042f619208d4614adfa9"><div class="ttname"><a href="class_h_a_l.html#a1c5c73cce4de042f619208d4614adfa9">HAL::spiInit</a></div><div class="ttdeci">static void spiInit(uint8_t spiRate)</div><div class="ttdef"><b>Definition:</b> HAL.h:635</div></div>
<div class="ttc" id="class_h_a_l_html_a5b72954f16d050f2510cc9bf19a71996"><div class="ttname"><a href="class_h_a_l.html#a5b72954f16d050f2510cc9bf19a71996">HAL::serialWriteByte</a></div><div class="ttdeci">static void serialWriteByte(char b)</div><div class="ttdef"><b>Definition:</b> HAL.h:604</div></div>
<div class="ttc" id="_h_a_l_8h_html_afe7387252655a7ee07b26cb83c5ed0be"><div class="ttname"><a href="_h_a_l_8h.html#afe7387252655a7ee07b26cb83c5ed0be">EEPROM_OFFSET</a></div><div class="ttdeci">#define EEPROM_OFFSET</div><div class="ttdef"><b>Definition:</b> HAL.h:130</div></div>
<div class="ttc" id="_h_a_l_8h_html_a3f1bffae8d9bb8c41c21d1924b5c294c"><div class="ttname"><a href="_h_a_l_8h.html#a3f1bffae8d9bb8c41c21d1924b5c294c">ufast8_t</a></div><div class="ttdeci">uint8_t ufast8_t</div><div class="ttdef"><b>Definition:</b> HAL.h:161</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_acf7cd14be8d0209dba34fa8c4451854d"><div class="ttname"><a href="class_r_f_hardware_serial.html#acf7cd14be8d0209dba34fa8c4451854d">RFHardwareSerial::_ubrrh</a></div><div class="ttdeci">volatile uint8_t * _ubrrh</div><div class="ttdef"><b>Definition:</b> HAL.h:220</div></div>
<div class="ttc" id="class_h_a_l_html_a39e4e2dc4288878b5525a625d8fe129c"><div class="ttname"><a href="class_h_a_l.html#a39e4e2dc4288878b5525a625d8fe129c">HAL::Div4U2U</a></div><div class="ttdeci">static int32_t Div4U2U(uint32_t a, uint16_t b)</div><div class="ttdoc">Optimized division. </div><div class="ttdef"><b>Definition:</b> HAL.h:291</div></div>
<div class="ttc" id="_h_a_l_8h_html_aaa07390e6158db5d82d40510d2ae02d5"><div class="ttname"><a href="_h_a_l_8h.html#aaa07390e6158db5d82d40510d2ae02d5">SERIAL_BUFFER_SIZE</a></div><div class="ttdeci">#define SERIAL_BUFFER_SIZE</div><div class="ttdef"><b>Definition:</b> HAL.h:190</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_ae094d10bba86856d32d8aef2c6103fd0"><div class="ttname"><a href="class_r_f_hardware_serial.html#ae094d10bba86856d32d8aef2c6103fd0">RFHardwareSerial::_rx_buffer</a></div><div class="ttdeci">ring_buffer * _rx_buffer</div><div class="ttdef"><b>Definition:</b> HAL.h:218</div></div>
<div class="ttc" id="class_h_a_l_html_abe5c809102eb9d2ae53deafba5f15fbe"><div class="ttname"><a href="class_h_a_l.html#abe5c809102eb9d2ae53deafba5f15fbe">HAL::readFlashWord</a></div><div class="ttdeci">static int16_t readFlashWord(PGM_P ptr)</div><div class="ttdef"><b>Definition:</b> HAL.h:588</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html"><div class="ttname"><a href="class_r_f_hardware_serial.html">RFHardwareSerial</a></div><div class="ttdef"><b>Definition:</b> HAL.h:215</div></div>
<div class="ttc" id="_h_a_l_8h_html_afbb1290b3ca9b145cd2f83d39cccf570"><div class="ttname"><a href="_h_a_l_8h.html#afbb1290b3ca9b145cd2f83d39cccf570">RFSerial</a></div><div class="ttdeci">RFHardwareSerial RFSerial</div></div>
<div class="ttc" id="_h_a_l_8h_html_a5f255edd429b0abc92fae25c511d45a7"><div class="ttname"><a href="_h_a_l_8h.html#a5f255edd429b0abc92fae25c511d45a7">millis_t</a></div><div class="ttdeci">uint32_t millis_t</div><div class="ttdef"><b>Definition:</b> HAL.h:158</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a9f98a4add0666d6e74f2e3d9b276b053"><div class="ttname"><a href="class_r_f_hardware_serial.html#a9f98a4add0666d6e74f2e3d9b276b053">RFHardwareSerial::_udr</a></div><div class="ttdeci">volatile uint8_t * _udr</div><div class="ttdef"><b>Definition:</b> HAL.h:224</div></div>
<div class="ttc" id="class_h_a_l_html_a5cae8bbfb20d624ffac8bb13ca8e82d6"><div class="ttname"><a href="class_h_a_l.html#a5cae8bbfb20d624ffac8bb13ca8e82d6">HAL::eprSetInt32</a></div><div class="ttdeci">static void eprSetInt32(unsigned int pos, int32_t value)</div><div class="ttdef"><b>Definition:</b> HAL.h:538</div></div>
<div class="ttc" id="class_interrupt_protected_block_html_a8b4978ff4726206e8739c7cbbd660ad7"><div class="ttname"><a href="class_interrupt_protected_block.html#a8b4978ff4726206e8739c7cbbd660ad7">InterruptProtectedBlock::sreg</a></div><div class="ttdeci">uint8_t sreg</div><div class="ttdef"><b>Definition:</b> HAL.h:105</div></div>
<div class="ttc" id="class_h_a_l_html_aef854d58f64fc3f20e11bd76c331f287"><div class="ttname"><a href="class_h_a_l.html#aef854d58f64fc3f20e11bd76c331f287">HAL::eprSetByte</a></div><div class="ttdeci">static void eprSetByte(unsigned int pos, uint8_t value)</div><div class="ttdef"><b>Definition:</b> HAL.h:530</div></div>
<div class="ttc" id="_h_a_l_8h_html_a806ea970ccbc3c57a4d4ad45dbbb4725"><div class="ttname"><a href="_h_a_l_8h.html#a806ea970ccbc3c57a4d4ad45dbbb4725">TIMER0_PRESCALE</a></div><div class="ttdeci">#define TIMER0_PRESCALE</div><div class="ttdoc">Prescale factor, timer0 runs at. </div><div class="ttdef"><b>Definition:</b> HAL.h:60</div></div>
<div class="ttc" id="_display_list_8h_html_ace91a4e928d61240785c9438be8651d0"><div class="ttname"><a href="_display_list_8h.html#ace91a4e928d61240785c9438be8651d0">SDSS</a></div><div class="ttdeci">#define SDSS</div><div class="ttdef"><b>Definition:</b> DisplayList.h:1245</div></div>
<div class="ttc" id="fastio_8h_html"><div class="ttname"><a href="fastio_8h.html">fastio.h</a></div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a4f606b28efe0a9c8da02d39e4873da3a"><div class="ttname"><a href="class_r_f_hardware_serial.html#a4f606b28efe0a9c8da02d39e4873da3a">RFHardwareSerial::_ucsrb</a></div><div class="ttdeci">volatile uint8_t * _ucsrb</div><div class="ttdef"><b>Definition:</b> HAL.h:223</div></div>
<div class="ttc" id="class_interrupt_protected_block_html_a2fe8f727f9bb277945286d6d89a623b9"><div class="ttname"><a href="class_interrupt_protected_block.html#a2fe8f727f9bb277945286d6d89a623b9">InterruptProtectedBlock::~InterruptProtectedBlock</a></div><div class="ttdeci">~InterruptProtectedBlock()</div><div class="ttdef"><b>Definition:</b> HAL.h:124</div></div>
<div class="ttc" id="class_h_a_l_html_a56d49442ce5f9d581523326bcd39dd6c"><div class="ttname"><a href="class_h_a_l.html#a56d49442ce5f9d581523326bcd39dd6c">HAL::forbidInterrupts</a></div><div class="ttdeci">static void forbidInterrupts()</div><div class="ttdef"><b>Definition:</b> HAL.h:576</div></div>
<div class="ttc" id="class_h_a_l_html_ad0270c5521b937d841fbc964326503bb"><div class="ttname"><a href="class_h_a_l.html#ad0270c5521b937d841fbc964326503bb">HAL::tone</a></div><div class="ttdeci">static void tone(uint8_t pin, int duration)</div><div class="ttdef"><b>Definition:</b> HAL.h:522</div></div>
<div class="ttc" id="class_h_a_l_html_aa018bc25f18290bdbca1560657e78028"><div class="ttname"><a href="class_h_a_l.html#aa018bc25f18290bdbca1560657e78028">HAL::ComputeV</a></div><div class="ttdeci">static unsigned int ComputeV(long timer, long accel)</div><div class="ttdef"><b>Definition:</b> HAL.h:398</div></div>
<div class="ttc" id="class_h_a_l_html_a5890acd2f9a8e5880e018747de54c470"><div class="ttname"><a href="class_h_a_l.html#a5890acd2f9a8e5880e018747de54c470">HAL::eprSetInt16</a></div><div class="ttdeci">static void eprSetInt16(unsigned int pos, int16_t value)</div><div class="ttdef"><b>Definition:</b> HAL.h:534</div></div>
<div class="ttc" id="class_interrupt_protected_block_html_a9b73a25ab6cd42d6a583b0f13f78ead1"><div class="ttname"><a href="class_interrupt_protected_block.html#a9b73a25ab6cd42d6a583b0f13f78ead1">InterruptProtectedBlock::protect</a></div><div class="ttdeci">void protect()</div><div class="ttdef"><b>Definition:</b> HAL.h:107</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_acece6a5e7d8983146c068386b4f0febc"><div class="ttname"><a href="class_r_f_hardware_serial.html#acece6a5e7d8983146c068386b4f0febc">RFHardwareSerial::_rxen</a></div><div class="ttdeci">uint8_t _rxen</div><div class="ttdef"><b>Definition:</b> HAL.h:225</div></div>
<div class="ttc" id="class_h_a_l_html_a9fabb6946e5c0d77b74f3068c4b11d32"><div class="ttname"><a href="class_h_a_l.html#a9fabb6946e5c0d77b74f3068c4b11d32">HAL::serialByteAvailable</a></div><div class="ttdeci">static bool serialByteAvailable()</div><div class="ttdef"><b>Definition:</b> HAL.h:596</div></div>
<div class="ttc" id="structring__buffer__tx_html_a3e2ee9eff771641b8f0d218d89a760a6"><div class="ttname"><a href="structring__buffer__tx.html#a3e2ee9eff771641b8f0d218d89a760a6">ring_buffer_tx::tail</a></div><div class="ttdeci">volatile uint8_t tail</div><div class="ttdef"><b>Definition:</b> HAL.h:212</div></div>
<div class="ttc" id="_h_a_l_8h_html_adfaa4526bb47342be47f89a9eb6b3bef"><div class="ttname"><a href="_h_a_l_8h.html#adfaa4526bb47342be47f89a9eb6b3bef">fast8_t</a></div><div class="ttdeci">int8_t fast8_t</div><div class="ttdef"><b>Definition:</b> HAL.h:160</div></div>
<div class="ttc" id="_h_a_l_8cpp_html_a73fea6a0baf160327564ce5b4110d099"><div class="ttname"><a href="_h_a_l_8cpp.html#a73fea6a0baf160327564ce5b4110d099">__attribute__</a></div><div class="ttdeci">long __attribute__((used)) stepperWait=0</div></div>
<div class="ttc" id="structring__buffer__tx_html_a51a189b8d08a2712ea0bc7f2a64b4106"><div class="ttname"><a href="structring__buffer__tx.html#a51a189b8d08a2712ea0bc7f2a64b4106">ring_buffer_tx::head</a></div><div class="ttdeci">volatile uint8_t head</div><div class="ttdef"><b>Definition:</b> HAL.h:211</div></div>
<div class="ttc" id="class_interrupt_protected_block_html_a51aa9f4410ffdd3f9c46bcdb9122a91c"><div class="ttname"><a href="class_interrupt_protected_block.html#a51aa9f4410ffdd3f9c46bcdb9122a91c">InterruptProtectedBlock::InterruptProtectedBlock</a></div><div class="ttdeci">InterruptProtectedBlock(bool later=false)</div><div class="ttdef"><b>Definition:</b> HAL.h:117</div></div>
<div class="ttc" id="_h_a_l_8h_html_a19b13c479504642297e7ebbf5da5677b"><div class="ttname"><a href="_h_a_l_8h.html#a19b13c479504642297e7ebbf5da5677b">ticks_t</a></div><div class="ttdeci">uint32_t ticks_t</div><div class="ttdef"><b>Definition:</b> HAL.h:157</div></div>
<div class="ttc" id="class_h_a_l_html_aa57e04102fc3c5df107def4f5477770c"><div class="ttname"><a href="class_h_a_l.html#aa57e04102fc3c5df107def4f5477770c">HAL::spiReadBlock</a></div><div class="ttdeci">static void spiReadBlock(uint8_t *buf, size_t nbyte)</div><div class="ttdef"><b>Definition:</b> HAL.h:661</div></div>
<div class="ttc" id="class_h_a_l_html_a55b098463a975b7eaad112512fcc4412"><div class="ttname"><a href="class_h_a_l.html#a55b098463a975b7eaad112512fcc4412">HAL::delayMicroseconds</a></div><div class="ttdeci">static void delayMicroseconds(unsigned int delayUs)</div><div class="ttdef"><b>Definition:</b> HAL.h:514</div></div>
<div class="ttc" id="structring__buffer_html"><div class="ttname"><a href="structring__buffer.html">ring_buffer</a></div><div class="ttdef"><b>Definition:</b> HAL.h:202</div></div>
<div class="ttc" id="class_h_a_l_html_a589acc269001f4059a5f680ad1246f1a"><div class="ttname"><a href="class_h_a_l.html#a589acc269001f4059a5f680ad1246f1a">HAL::spiBegin</a></div><div class="ttdeci">static void spiBegin()</div><div class="ttdef"><b>Definition:</b> HAL.h:618</div></div>
<div class="ttc" id="class_h_a_l_html_a67ab4c0165c9c9d90bf3e0f231ba3b59"><div class="ttname"><a href="class_h_a_l.html#a67ab4c0165c9c9d90bf3e0f231ba3b59">HAL::noTone</a></div><div class="ttdeci">static void noTone(uint8_t pin)</div><div class="ttdef"><b>Definition:</b> HAL.h:526</div></div>
<div class="ttc" id="class_h_a_l_html_a47b2e7af785eccd67dc61efc9dd62d88"><div class="ttname"><a href="class_h_a_l.html#a47b2e7af785eccd67dc61efc9dd62d88">HAL::serialFlush</a></div><div class="ttdeci">static void serialFlush()</div><div class="ttdef"><b>Definition:</b> HAL.h:608</div></div>
<div class="ttc" id="class_r_f_hardware_serial_html_a9d5f3f3062701316ad2d893e051c6f6f"><div class="ttname"><a href="class_r_f_hardware_serial.html#a9d5f3f3062701316ad2d893e051c6f6f">RFHardwareSerial::_rxcie</a></div><div class="ttdeci">uint8_t _rxcie</div><div class="ttdef"><b>Definition:</b> HAL.h:227</div></div>
<div class="ttc" id="structring__buffer_html_a6a4c701d83019fe9b6ce59e39daf7925"><div class="ttname"><a href="structring__buffer.html#a6a4c701d83019fe9b6ce59e39daf7925">ring_buffer::head</a></div><div class="ttdeci">volatile uint8_t head</div><div class="ttdef"><b>Definition:</b> HAL.h:205</div></div>
<div class="ttc" id="fastio_8h_html_afa76df25ccdb2d113a057c8c305399cc"><div class="ttname"><a href="fastio_8h.html#afa76df25ccdb2d113a057c8c305399cc">SET_INPUT</a></div><div class="ttdeci">#define SET_INPUT(IO)</div><div class="ttdoc">set pin as input wrapper </div><div class="ttdef"><b>Definition:</b> fastio.h:54</div></div>
<div class="ttc" id="class_h_a_l_html_a0f699472c569705aa31dd0be7f129edc"><div class="ttname"><a href="class_h_a_l.html#a0f699472c569705aa31dd0be7f129edc">HAL::stopWatchdog</a></div><div class="ttdeci">static void stopWatchdog()</div><div class="ttdef"><b>Definition:</b> HAL.h:734</div></div>
<div class="ttc" id="_h_a_l_8h_html_a17da3e86d60c2b299dd9e523bf746699"><div class="ttname"><a href="_h_a_l_8h.html#a17da3e86d60c2b299dd9e523bf746699">RFSERIAL</a></div><div class="ttdeci">#define RFSERIAL</div><div class="ttdef"><b>Definition:</b> HAL.h:252</div></div>
<div class="ttc" id="class_h_a_l_html_a721b2765f2dcb2a8a4f5fea28d551136"><div class="ttname"><a href="class_h_a_l.html#a721b2765f2dcb2a8a4f5fea28d551136">HAL::pinMode</a></div><div class="ttdeci">static void pinMode(uint8_t pin, uint8_t mode)</div><div class="ttdef"><b>Definition:</b> HAL.h:509</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_cdf0096ae548159f0698b0a71289cf6c.html">ArduinoAVR</a></li><li class="navelem"><a class="el" href="dir_360d65efbdba454d299657bac363b72c.html">Repetier</a></li><li class="navelem"><a class="el" href="_h_a_l_8h.html">HAL.h</a></li>
    <li class="footer">Generated on Tue Sep 19 2017 18:54:00 for Repetier-Firmware by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
